package com.sven;

import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("hello")
public class HelloController {

    // @Reference
    // private IHelloService helloService;

    //配置降级，返回兜底数据
    @Reference(mock = "com.sven.MockHelloService" ,cluster = "failfast")
    private IHelloService helloService;

    @RequestMapping("f01")
    public String hello(){
        System.out.println(System.getProperty("DUBBO_IP_TO_BIND"));
        System.out.println(System.getProperty("DUBBO_IP_TO_REGISTRY"));
        String st = helloService.sayHello("沙县");
        System.out.println(st);
        return st;
    }
}
